<?php
	session_start();
	if($_SESSION['id_member'] == '' || $_SESSION['id_member'] == 'BOS000'){
		$ses_id = session_id();
		$tgl = date("dmy");
		$id_session = "$tgl$ses_id";
		session_register("id_session");
		$_SESSION['id_session'] = $id_session;
		$_SESSION['id_member'] = "BOS000";
	}else if($_SESSION['id_member'] != 'BOS000'){
		$id_session = $_SESSION['id_session'];
	}
	$id_member = $_SESSION['id_member'];
  
	require_once "setting/kon.php";
	require_once "setting/library.php";
	
	function full_url($s)
	{
		$ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true:false;
		$sp = strtolower($s['SERVER_PROTOCOL']);
		$protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');
		$port = $s['SERVER_PORT'];
		$port = ((!$ssl && $port=='80') || ($ssl && $port=='443')) ? '' : ':'.$port;
		$host = isset($s['HTTP_X_FORWARDED_HOST']) ? $s['HTTP_X_FORWARDED_HOST'] : isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : $s['SERVER_NAME'];
		return $s['REQUEST_URI'];
	}
?>
<html lang="en">
  
<!-- Mirrored from getbootstrap.com/examples/starter-template/ by HTTrack Website Copier/3.x [XR&CO'2013], Wed, 02 Oct 2013 12:14:27 GMT -->
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="../../asset/ico/favicon.png">

    <title>Battle of Surabaya</title>

    <link href="asset/css/custom.css" rel="stylesheet">
    <!-- Bootstrap core CSS -->
    <link href="asset/css/bootstrap.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="../../assets/js/html5shiv.js"></script>
      <script src="../../assets/js/respond.min.js"></script>
    <![endif]-->
	<script src="asset/js/jquery-1.8.2.min.js"></script>
	<script src="asset/js/gsFormValidator/gsAnimeFormValidator.js"></script>
	<link href="asset/js/gsFormValidator/gsAnimeFormValidator.css" rel="stylesheet" type="text/css">
	<script type="text/javascript">
		function loadAjax(url,id) {
			$("#"+id).show();
			$.ajax ({
				url : url,
				cache : false,
				success: function(html){
					$("#"+id).html(html);
				}
			});	
		}
		function insert_cart(id_produk){
			var dataString = 'id_produk='+ id_produk;
			$.ajax({
				type: "POST",
				url: "ajax/insert_cart.php",
				data: dataString,
				cache: false,
				success: function(html){
					loadAjax('ajax/cart.php','cart');
				} 
			});
		}
		function delete_cart(id_temp){
			var dataString = 'id_temp='+ id_temp;
			$.ajax({
				type: "POST",
				url: "ajax/delete_cart.php",
				data: dataString,
				cache: false,
				success: function(html){
					loadAjax('ajax/cart.php','cart');
					loadAjax('ajax/keranjang.php','checkout');
				} 
			});
		}
	</script>
 
  </head>

  <body>

    <!-- modal (yang ditampilkan di lightbox) -->
    <div class="modal fade" id="modalLogin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title">Log in Area</h4>
          </div>
          <div class="modal-body">
            <form class="form-horizontal" role="form" action="login.aspx" method="post">
              <div class="form-group">
                <label class="col-lg-2 control-label">Email</label>
                <div class="col-lg-10">
                  <input type="email" name="email" class="form-control input-sm" placeholder="Enter Email">
                </div>
              </div>
              <div class="form-group">
                <label class="col-lg-2 control-label">Password</label>
                <div class="col-lg-10">
                  <input type="password" name="pass" class="form-control input-sm" placeholder="Enter Password">
                </div>
              </div>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">Close</button>
            <button type="submit" class="btn btn-danger btn-sm">Log in</button>
          </form>
          </div>
        </div><!-- /.modal-content -->
      </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    <!-- end modal -->

    <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="row">
          <div class="col-md-10 col-md-offset-1">
            <div class="col-md-12">
              <div class="row">
                <div class="col-md-4">
                  <div class="logo">
                    <img src="asset/images/logo.jpg">
                  </div>
                <div class="clearfix"></div>
                </div>
                <div class="col-md-5"></div>
                <div class="col-md-3">
                    <div class="link-login-reg">
                      <a href="register.aspx">Register</a> |
                      <a data-toggle="modal" href="#modalLogin">Log in</a>
                    </div>
                <div class="clearfix"></div>
                </div>
              </div>
            <div class="clearfix"></div>
            </div>
            <div class="col-md-12 orange-header">
              <div class="row">
                <div class="col-md-3">
                  <!-- <a href="home.aspx"><span class="glyphicon glyphicon-home"></span></a> &nbsp;
				          <a href="#"><span class="glyphicon glyphicon-question-sign"></span></a> -->
                  <div class="menu-atas">
                    <ul>
                      <li><a href="home.aspx">Home</a></li>
                      <li><a href="cara-beli.aspx">Cara Beli</a></li>
                      <li><a href="konfirmasi.aspx">Konfirmasi</a></li>
                    </ul>
                  <div class="clearfix"></div>
                  </div>
                </div>
                <div class="col-md-6 margin-top-header">
        					<form action="pencarian.aspx" method="post" style="margin-bottom: 0px;">
        						<div class="input-group input-group-sm">
        							<input type="text" name="cari" class="form-control" placeholder="Cari produk...">
        							<span class="input-group-addon">
        								<span class="glyphicon glyphicon-search"></span>
        							</span>
        							<div class="clearfix"></div>
        						</div>
        					</form>
                </div>
                <div class="col-md-3 margin-top-header">
                  <a href="checkout.aspx" class="btn btn-danger btn-sm btn-100p">
                    <span class="glyphicon glyphicon-shopping-cart"></span>&nbsp;
					<span id="cart">
						<?php
							$sttmt = $koneksi->query("select sum(jumlah) as jumlah from order_temp where id_session = '$id_session'");
							$hasil = $sttmt->fetch(PDO::FETCH_ASSOC);
							$jml_beli = $hasil["jumlah"];
							if($jml_beli == ''){
								$jml_beli = 0;
							}
							echo "Troli (".$jml_beli.") item";
						?>
					</span>
                  </a>
                <div class="clearfix"></div>
                </div>
              </div>
            <div class="clearfix"></div>
            </div>
          <div class="clearfix"></div>            
          </div>
        </div>
      <div class="clearfix"></div>
      </div>
      <div class="clearfix"></div>
    </div>
<!-- start content -->

    <div class="container">
      <div class="row">
        <div class="col-md-10 col-md-offset-1 margin-container-login">
          <div class="row">
            <div class="col-md-3">
              <?php
				if($id_member != '' and $id_member != 'BOS000'){
			  ?>
				  <div class="outer-border nav-page-sidebar-p5">
					<div class="nav-judul bg-texture">
					  <span class="judul-sidebar">
						Akun
					  </span>
					</div>
					<div class="nav-page-sidebar-nop">
					  <ul class="menu_simple">
						<li><a href='#'>Ganti Password</a></li>
						<li><a href='biodata.aspx'>Data Diri</a></li>
						<li><a href='transaksi.aspx'>Data Transaksi</a></li>
						<li><a href='logout.aspx'>Logout</a></li>
					  </ul>
					</div>
				  </div>
			  <?php
				}
			  ?>
			  <div class="outer-border nav-page-sidebar-p5">
                <div class="nav-judul bg-texture">
                  <span class="judul-sidebar">
                    All Categories
                  </span>
                </div>
                <div class="nav-page-sidebar-nop">
                  <ul class="menu_simple">
					<?php
						$sttmt = $koneksi->query("select * from kategori");
						while($row = $sttmt->fetch(PDO::FETCH_ASSOC)){
							echo "<li><a href='kategori-$row[slug_kategori]'>$row[kategori]</a></li>";
						}
					?>
                  </ul>
                </div>
              </div>

              <div class="outer-border nav-page-sidebar-p5">
                <div class="nav-judul bg-texture">
                  <span class="judul-sidebar">
                    Partner Link
                  </span>
                </div>
                <div class="nav-page-sidebar-nop">
        					<?php
        						$sttmt = $koneksi->query("select * from patner where aktif = 'Y'");
        						while($row = $sttmt->fetch(PDO::FETCH_ASSOC)){
        							echo "<a href='$row[link]' target='_BLANK'>
        							<center><img src='patner/$row[logo]' class='image-responsive' style='max-width: 150px'></center></a>";
        						}
        					?>
                </div>
              </div>
              <div class="outer-border nav-page-sidebar-p5">
                <div class="nav-judul bg-texture">
                  <span class="judul-sidebar">
                    Fans Page
                  </span>
                </div>
                <div class="nav-page-sidebar-nop">
                  <center>
                    <iframe class="" height="350" frameborder="0" width="100%" scrolling="no" name="f14fcf3b3c1d296" allowtransparency="true" title="fb:like_box Facebook Social Plugin" style="border: medium none; visibility: visible; width: 100%;" src="http://www.facebook.com/plugins/like_box.php?app_id=&channel=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D28%23cb%3Df326c45bbf44414%26domain%3Dbattleofsurabayathemovie.com%26origin%3Dhttp%253A%252F%252Fbattleofsurabayathemovie.com%252Ff1e20bf9fd9c9e%26relation%3Dparent.parent&color_scheme=dark&header=false&height=350&href=https%3A%2F%2Fwww.facebook.com%2FBattleOfSurabayaTheMovie&locale=en_US&sdk=joey&show_border=false&show_faces=true&stream=false&width=200"></iframe>
                  </center>
                </div>
              </div>
            </div>
            <!-- start kanan -->
            <?php
              $file = (isset($_GET['file'])) ? ($_GET['file']) : 'home';
              if (file_exists($file . '.php')) {
                  include $file . '.php';
              } else {
                  echo "<p><b>URUNG DI GAWE</b></p>";
              }
            ?>
            <!-- end kanan -->
          </div>
        </div><div class="clearfix"></div>
      </div>
    </div><!-- /.container -->
    <div class="clearfix"></div>
<!-- end content --> 
	<div id="showGsAlert"></div>
<!-- start footer --> 
    <div class="navbar navbar-default navbar-fixed-bottom orange-header" role="navigation">
      <div class="container">
        <div class="row">
          <div class="col-md-10 col-md-offset-1">
            <div class="text-footer">
              Copyright&copy; 2014 Battle of Surabaya. All Rights Reserved.
            </div>
          <div class="clearfix"></div>            
          </div>
        </div>
      <div class="clearfix"></div>
      </div>
      <div class="clearfix"></div>
    </div>   
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="asset/js/jquery.js"></script>
    <script src="asset/js/bootstrap.min.js"></script>
    <!-- for slide -->
    <script>
      $('.carousel').carousel({
        interval: 4000
      })
    </script>
    <!-- end slide -->
    <!-- for modal -->
    <script>
      $('#modalLogin').modal(options)
    </script>
    <!-- end modal -->
  </body>

<!-- Mirrored from getbootstrap.com/examples/starter-template/ by HTTrack Website Copier/3.x [XR&CO'2013], Wed, 02 Oct 2013 12:14:27 GMT -->
</html>
